package textapp.connector.model;

import java.util.List;

public class GroupModel {

	private int id;
	
	private UserModel owner;
	
	private String name;
	
	private int type; // 0 = normal (created by user), 1 = temporary
	
	private List<GroupUserModel> groupUsers;

	


	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public UserModel getOwner() {
		return owner;
	}

	public void setOwner(UserModel owner) {
		this.owner = owner;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public List<GroupUserModel> getGroupUsers() {
		return groupUsers;
	}

	public void setGroupUsers(List<GroupUserModel> groupUsers) {
		this.groupUsers = groupUsers;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof GroupModel)) {
			return false;
		}
		GroupModel other = (GroupModel) obj;
		if (other.getId() == 0) {
			return false;
		}
		return (this.id == other.getId());
		
	}
}
